package clases;

import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="CuentasCorriente")
public class CuentaCorriente {

	private int nrocuenta;
	private float saldoactual;
	private String Titular;
	private Collection <Factura>facturas;
	private Collection <Pago>pagos;
	
	@Id
	@Column(name="ID")
	public int getNrocuenta() {return nrocuenta;}
	public void setNrocuenta(int nrocuenta) {this.nrocuenta = nrocuenta;}
	@Column(name="SALDO")
	public float getSaldoactual() {return saldoactual;}
	public void setSaldoactual(float saldoactual) {this.saldoactual = saldoactual;}
	@Column(name="TITULAR")
	public String getTitular() {return Titular;}
	public void setTitular(String titular) {Titular = titular;}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuentacorriente")
	public Collection<Factura> getFacturas() {return facturas;}
	public void setFacturas(Collection<Factura> facturas) {this.facturas = facturas;}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuentacorriente")
	public Collection<Pago> getPagos() {return pagos;}
	public void setPagos(Collection<Pago> pagos) {this.pagos = pagos;}
}

